const state = {
  token: "",
  userInfo: {},
};
const getters = {};
const actions = {
  onInit({ commit }) {
    commit("setToken", uni.getStorageSync("X-Token"));
    commit("setUserInfo", uni.getStorageSync("X-UserInfo"));
  },
};
const mutations = {
  setToken(state, token) {
    state.token = token;
  },
  setUserInfo(state, userInfo) {
    state.userInfo = userInfo;
  },
};
export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations,
};
